appropriate dependent libraries linked in-please check that the project settings \r
contain the correct .lib file names for your system, as they assume the most \r
common names are used there.\r
+\r
+=========================\r
+Building the translations\r
+=========================\r
+Building translations is supported via Meson builds or via the Visual Studio projects,\r
+both of which require a working msgfmt.exe (from gettext-tools, a part of gettext) in the\r
+PATH, or for the Visual Studio projects, passed into the arguments in "InstallBuildsBase"\r
+in gtk3-build-defines.[props|vsprops] with MSGFMT=xxx. For the Visual Studio projects, for\r
+this to work one needs to also supply a "INSTALL_TRANSLATIONS=1" (without the quotes)\r
+argument to the same "InstallBuildsBase" in the afore-mentioned property sheet. Using\r
+msgfmt.exe from Cygwin or MSYS2 is supported as well.\r
GLIB_COMPILE_SCHEMAS = $(PREFIX)\bin\glib-compile-schemas.exe
!endif
+!ifndef MSGFMT
+MSGFMT = msgfmt
+!endif
+
!if "$(PLAT)" == "x64"
AT_PLAT=x86_64
!elseif "$(PLAT)" == "arm64"
GTK_VERSION_H = .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gtk-$(GTK_API_VERSION)\gtk\gtkversion.h
GTK_GENERATED_PUBLIC_H = $(GTK_TYPE_BULITINS_H) $(GTK_VERSION_H)
-all: install-bin install-headers install-data
+!ifdef INSTALL_TRANSLATIONS
+DATA_TARGETS = install-data install-translations
+!else
+DATA_TARGETS = install-data
+!endif
+
+all: install-bin install-headers $(DATA_TARGETS)
# Copy the built files
install-bin:
@for %x in (its loc) do @copy ..\gtk\gtkbuilder.%x $(PREFIX)\share\gettext\its
@for %x in (rng) do @copy ..\gtk\gtkbuilder.%x $(PREFIX)\share\gtk-3.0
@for %l in (de es fr zh) do @for %f in ($(BASE_BUILT_BIN_DIR)\%l.gresource) do @copy %f $(PREFIX)\share\gtk-3.0\emoji
+
+# Generate and install the translations
+install-translations:
+ @for %d in (po po-properties) do @for %l in (..\%d\*.po) do @if not exist $(PREFIX)\share\locale\%~nl\LC_MESSAGES\ md $(PREFIX)\share\locale\%~nl\LC_MESSAGES
+ @for %l in (..\po\*.po) do @$(MSGFMT) -c -v -o $(PREFIX)\share\locale\%~nl\LC_MESSAGES\gtk30.mo %l
+ @for %l in (..\po-properties\*.po) do @$(MSGFMT) -c -v -o $(PREFIX)\share\locale\%~nl\LC_MESSAGES\gtk30-properties.mo %l